<template>
    <div>

        <!-- 轮播图区域  -->
        <mt-swipe :auto="4000">
            <!-- 在组件使用v-for 循环的时候，一定加 :key -->
        <mt-swipe-item v-for="item in lunbotuList" :key="item.id">
            <img :src="item.url"/>
        </mt-swipe-item>
        </mt-swipe>


        <!-- 九宫格 到 六宫格的改造过程 -->
         <ul class="mui-table-view mui-grid-view mui-grid-9">
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <img src="../../images/menu1.png" alt="">
                    <div class="mui-media-body">新闻资讯</div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <img src="../../images/menu2.png" alt="">
                    <div class="mui-media-body">图片分享</div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <img src="../../images/menu3.png" alt="">
                    <div class="mui-media-body">商品购买</div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <img src="../../images/menu4.png" alt="">
                    <div class="mui-media-body">留言反馈</div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <img src="../../images/menu5.png" alt="">
                    <div class="mui-media-body">视频专区</div></a></li>
            <li class="mui-table-view-cell mui-media mui-col-xs-4 mui-col-sm-3"><a href="#">
                    <img src="../../images/menu6.png" alt="">
                    <div class="mui-media-body">联系我们</div></a></li>      
         </ul> 

    </div>
</template>

<script>

import { Toast } from 'mint-ui'

export default {
    data(){
        return {
            //假数据...
            lunbotuList:[
                {
                    id:1,
                    url:'http://www.haoqilu.cn/uploadfile/2019/0802/20190802035221393.jpg'
                },
                {
                    id:2,
                    url:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1567011960265&di=236b11f97f92fa0e2f3eb9f5a11fc3ac&imgtype=0&src=http%3A%2F%2Fe.hiphotos.baidu.com%2Fimage%2Fpic%2Fitem%2F4610b912c8fcc3cef70d70409845d688d53f20f7.jpg'
                },
                 {
                    id:3,
                    url:'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2501396165,3137197004&fm=26&gp=0.jpg'
                }
            ]
        }
    },
    created(){
        // this.getLunbotu()
    },
    methods: {
        // getLunbotu(){
        //     this.$http.get("http://vue.study.io/api/getlunbo").then(result =>{
        //         //console.log(result.body)
        //         if(result.body.status === 0 ){
        //             this.lunbotuList = result.body.message
        //              Toast('加载轮播图成功')
        //         }else{
        //             Toast('加载轮播图失败')
        //         }
        //     })
        // }
    }
}

</script>

<style lang="scss" scoped>
.mint-swipe{
    height: 200px;
    //加载轮播图颜色方法一
    // .mint-swipe-item:nth-child(1){
    //     background-color:red;
    // }
    //  .mint-swipe-item:nth-child(2){
    //     background-color:rgb(0, 255, 76);
    // }
    //  .mint-swipe-item:nth-child(3){
    //     background-color:rgb(76, 0, 255);
    // }
    //方法二
    .mint-swipe-item{
        &:nth-child(1){
            background-color: red
        }
        &:nth-child(2){
            background-color: blue
        }
        &:nth-child(3){
            background-color: yellow
        }

        img{
            width:100%;
            height:100%;
        }
    }
}
.mui-grid-view.mui-grid-9{
    background-color: #ffffff;
    border:none; 
    img{
        width: 60px;
        height: 60px;
    }
    .mui-media-body{
        font-size: 13px;
    }
}
.mui-grid-view.mui-grid-9 .mui-table-view-cell{
      border:none; 
}
</style>